<template>
  <div class="login">
    <div class="top-box">
      <img class="logo" src="@/assets/img/login/pic-loding.png" alt="" />
    </div>

    <div class="center-box">
      <img class="login-logo" src="@/assets/img/login/pic-login.svg" alt="" />
      <div class="login-box">
        <div class="title">微信登录</div>
        <div class="wechat">
          <button
            v-for="(item, index) in userArr"
            :key="index"
            @click="chooseUser(index, item)"
          >
            选择用户{{ index }}
          </button>
        </div>
        <div class="tips">请使用微信扫码二维码登录</div>
      </div>
    </div>
    <div class="bottom-box">
      <div class="title">即开即用、合规管理、私域连接一触即发</div>
      <div class="tips">
        <span>Copyright © 2010-2021</span>
        <span class="mar16-left">上海软素科技有限公司 版权所有</span>
        <img src="@/assets/img/login/icon-beian.svg" alt="" />
        <span>沪ICP备11017254号-19</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      userArr: [
        {
          userId: "userA",
        },

        {
          userId: "user_5823172",
        },
        {
          userId: "user_5823173",
        },
        {
          userId: "user_5823174",
        },
        {
          userId: "user_5823175",
        },
        {
          userId: "user_5823176",
        },
        // //分享占用
        // {
        //   userId: "user_5823177",
        // },
        // //白板流占用
        // {
        //   userId: "user_5823178",
        // },
      ],
      userId: "", //用户id --可更改
      userSig: "",
    };
  },
  mounted() {},
  methods: {
    chooseUser(index, item) {
      if (item.isUse) {
        alert("当前用户已被使用,请选择其他用户");
      }
      this.userId = item.userId;
      // this.userSig = item.userSig;
      localStorage.setItem("userInfo", JSON.stringify(item));
      this.$router.push({
        name: "roomList",
        query: item,
      });
    },
  },
};
</script>

<style  lang="scss" scoped>
.login {
  height: 100%;
  width: 100%;
  background: #ffffff;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  .top-box {
    position: absolute;
    left: 40px;
    top: 24px;
    display: flex;
    align-items: center;
    .logo {
      height: 35px;
      width: 100px;
    }
  }
  .center-box {
    display: flex;
    justify-content: space-between;
    .login-logo {
      width: 431px;
      height: 332px;
    }
    .login-box {
      margin-left: 175px;
      display: flex;
      flex-direction: column;
      align-items: center;
      .title {
        font-size: 21px;
        font-weight: 500;
        color: rgba(0, 0, 0, 0.65);
        line-height: 29px;
      }
      .wechat {
        width: 250.42px;
        height: 251.1px;
        border: solid 1px red;
        margin: 17px 0px 22px 0px;
      }
      .tips {
        font-size: 15px;
        font-weight: 500;
        color: rgba(0, 0, 0, 0.65);
        line-height: 21px;
      }
    }
  }
  .bottom-box {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    .title {
      font-size: 12px;
      font-weight: 400;
      color: #333333;
      line-height: 17px;
    }
    .tips {
      margin-top: 6px;
      font-size: 12px;
      font-weight: 400;
      color: #999999;
      line-height: 17px;
      display: flex;
      justify-content: center;
      align-items: center;
      img {
        width: 15px;
        height: 15px;
        margin-left: 16px;
        margin-right: 8px;
      }
    }
    .mar16-left {
      margin-left: 16px;
    }
  }
}
</style>

